projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cac3e77
)
gl: Make blur nodes with radius ∈ ]0; 1[
author
Timm Bäder
<mail@baedert.org>
Tue, 27 Feb 2018 13:22:08 +0000
(14:22 +0100)
committer
Timm Bäder
<mail@baedert.org>
Tue, 27 Feb 2018 13:22:08 +0000
(14:22 +0100)
Otherwise, the radius here ends up being 0 and we don't draw anything at
all.
gsk/resources/glsl/blur.fs.glsl
patch
|
blob
|
history
diff --git
a/gsk/resources/glsl/blur.fs.glsl
b/gsk/resources/glsl/blur.fs.glsl
index 19be916db1760dfc0056ea8eb7aed3a2f67c4843..abad1c1f3063a9f74fd93e7ad2582d0bd270a974 100644
(file)
--- a/
gsk/resources/glsl/blur.fs.glsl
+++ b/
gsk/resources/glsl/blur.fs.glsl
@@
-14,7
+14,7
@@
vec4 blur_pixel (in vec2 uv) {
// XXX The magic value here is GAUSSIAN_SCALE_FACTOR from gskcairoblur.c
float radius = u_blur_radius * 2.30348;
- int half_radius =
int(radius / 2.0
);
+ int half_radius =
max(int(radius / 2.0), 1
);
for (int y = -half_radius; y < half_radius; y ++) {
float fy = Gaussian (radius / 2.0, float(y));